Airflow control systems and methods using model predictive control

ABSTRACT

A torque requesting module generates a first torque request for a spark ignition engine based on driver input. A torque conversion module converts the first torque request into a second torque request. A setpoint control module, based on the second torque request, generates a mass of air per cylinder (APC) setpoint, an exhaust gas recirculation (EGR) setpoint, an intake valve phasing setpoint, and an exhaust valve phasing setpoint. A model predictive control (MPC) module: identifies sets of possible target values based on the APC, EGR, intake valve phasing, and exhaust valve phasing setpoints; generates predicted parameters based on a model of the spark ignition engine and the sets of possible target values, respectively; selects one of the sets of possible target values based on the predicted parameters; and sets target values based on the possible target values of the selected one of the sets.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No.61/815,002, filed on Apr. 23, 2013. The disclosure of the aboveapplication is incorporated herein by reference in its entirety.

This application is related to U.S. patent application Ser. No.13/911,148 filed on Jun. 6, 2013, Ser. No. 13/911,132 filed on Jun. 6,2013, and Ser. No. 13/911,156 filed on Jun. 6, 2013. The entiredisclosures of the above applications are incorporated herein byreference.

FIELD

The present disclosure relates to internal combustion engines and moreparticularly to engine control systems and methods for vehicles.

BACKGROUND

The background description provided here is for the purpose of generallypresenting the context of the disclosure. Work of the presently namedinventors, to the extent it is described in this background section, aswell as aspects of the description that may not otherwise qualify asprior art at the time of filing, are neither expressly nor impliedlyadmitted as prior art against the present disclosure.

Internal combustion engines combust an air and fuel mixture withincylinders to drive pistons, which produces drive torque. Air flow intothe engine is regulated via a throttle. More specifically, the throttleadjusts throttle area, which increases or decreases air flow into theengine. As the throttle area increases, the air flow into the engineincreases. A fuel control system adjusts the rate that fuel is injectedto provide a desired air/fuel mixture to the cylinders and/or to achievea desired torque output. Increasing the amount of air and fuel providedto the cylinders increases the torque output of the engine.

In spark-ignition engines, spark initiates combustion of an air/fuelmixture provided to the cylinders. In compression-ignition engines,compression in the cylinders combusts the air/fuel mixture provided tothe cylinders. Spark timing and air flow may be the primary mechanismsfor adjusting the torque output of spark-ignition engines, while fuelflow may be the primary mechanism for adjusting the torque output ofcompression-ignition engines.

Engine control systems have been developed to control engine outputtorque to achieve a desired torque. Traditional engine control systems,however, do not control the engine output torque as accurately asdesired. Further, traditional engine control systems do not provide arapid response to control signals or coordinate engine torque controlamong various devices that affect the engine output torque.

SUMMARY

In a feature, an engine control system for a vehicle is disclosed. Atorque requesting module generates a first torque request for a sparkignition engine based on driver input. A torque conversion moduleconverts the first torque request into a second torque request. Asetpoint control module, based on the second torque request, generates amass of air per cylinder (APC) setpoint, an exhaust gas recirculation(EGR) setpoint, an intake valve phasing setpoint, and an exhaust valvephasing setpoint. A model predictive control (MPC) module: identifiessets of possible target values based on the APC, EGR, intake valvephasing, and exhaust valve phasing setpoints; generates predictedparameters based on a model of the spark ignition engine and the sets ofpossible target values, respectively; selects one of the sets ofpossible target values based on the predicted parameters; and setstarget values based on the possible target values of the selected one ofthe sets. A throttle actuator module controls opening of a throttlevalve based on a first one of the target values.

In further features: a boost actuator module controls opening of awastegate based on a second one of the target values; an exhaust gasrecirculation (EGR) actuator module controls opening of an EGR valvebased on a third one of the target values; and a phaser actuator modulecontrols intake and exhaust valve phasing based on fourth and fifth onesof the target values.

In still further features, the MPC module selects the one of the sets ofpossible target values further based on the APC, EGR, intake valvephasing, and exhaust valve phasing setpoints.

In yet further features, the MPC module selects the one of the sets ofpossible target values based on comparisons of the APC, EGR, intakevalve phasing, and exhaust valve phasing setpoints with the predictedparameters, respectively.

In further features, the MPC module determines costs for the sets basedon: first comparisons of the APC setpoint with predicted APCs determinedfor the sets, respectively; second comparisons of the EGR setpoint withpredicted EGRs determined for the sets, respectively; third comparisonsof the intake valve phasing setpoint with predicted intake valve phasingvalues determined for the sets, respectively; and fourth comparisons ofthe exhaust valve phasing setpoint with predicted exhaust phasing valuesdetermined for the sets, respectively. The MPC module selects the one ofthe sets of possible target values based on the costs.

In still further features, the MPC module applies first, second, third,and fourth weighting values to the first, second, third, and fourthcomparisons, respectively, to determine the costs. The first weightingvalue is one of greater than and less than all of the second, third, andfourth weighting values.

In yet further features, the MPC module sets the target values to withinpredetermined ranges for the target values, respectively.

In further features, the setpoint module generates the APC, EGR, intakevalve phasing, and exhaust valve phasing setpoints further based ondesired combustion phasing.

In still further features, the setpoint module generates the APC, EGR,intake valve phasing, and exhaust valve phasing setpoints further basedon predetermined ranges for the APC, EGR, intake valve phasing, andexhaust valve phasing setpoints, respectively.

In yet further features, the setpoint module generates the APC, EGR,intake valve phasing, and exhaust valve phasing setpoints further basedon a number of deactivated cylinders.

In a feature, an engine control method for a vehicle includes:generating a first torque request for a spark ignition engine based ondriver input; converting the first torque request into a second torquerequest; and generating, based on the second torque request, a mass ofair per cylinder (APC) setpoint, an exhaust gas recirculation (EGR)setpoint, an intake valve phasing setpoint, and an exhaust valve phasingsetpoint. The method further includes, using a model predictive control(MPC) module: identifying sets of possible target values based on theAPC, EGR, intake valve phasing, and exhaust valve phasing setpoints;generating predicted parameters based on a model of the spark ignitionengine and the sets of possible target values, respectively; selectingone of the sets of possible target values based on the predictedparameters; and sets target values based on the possible target valuesof the selected one of the sets. The method further includes controllingopening of a throttle valve based on a first one of the target values.

In further features, the method further includes: controlling opening ofa wastegate based on a second one of the target values; controllingopening of an exhaust gas recirculation (EGR) valve based on a third oneof the target values; and controlling intake and exhaust valve phasingbased on fourth and fifth ones of the target values.

In still further features, the method further includes selecting the oneof the sets of possible target values further based on the APC, EGR,intake valve phasing, and exhaust valve phasing setpoints.

In yet further features, the method further includes selecting the oneof the sets of possible target values based on comparisons of the APC,EGR, intake valve phasing, and exhaust valve phasing setpoints with thepredicted parameters, respectively.

In further features, the method further includes determining costs forthe sets based on: first comparisons of the APC setpoint with predictedAPCs determined for the sets, respectively; second comparisons of theEGR setpoint with predicted EGRs determined for the sets, respectively;third comparisons of the intake valve phasing setpoint with predictedintake valve phasing values determined for the sets, respectively; andfourth comparisons of the exhaust valve phasing setpoint with predictedexhaust phasing values determined for the sets, respectively. The methodfurther includes selecting the one of the sets of possible target valuesbased on the costs.

In still further features, the method further includes applying first,second, third, and fourth weighting values to the first, second, third,and fourth comparisons, respectively, to determine the costs. The firstweighting value is one of greater than and less than all of the second,third, and fourth weighting values.

In yet further features, the method further includes setting the targetvalues to within predetermined ranges for the target values,respectively.

In further features, the method further includes generating the APC,EGR, intake valve phasing, and exhaust valve phasing setpoints furtherbased on desired combustion phasing.

In still further features, the method further includes generating theAPC, EGR, intake valve phasing, and exhaust valve phasing setpointsfurther based on predetermined ranges for the APC, EGR, intake valvephasing, and exhaust valve phasing setpoints, respectively.

In yet further features, the method further includes generating the APC,EGR, intake valve phasing, and exhaust valve phasing setpoints furtherbased on a number of deactivated cylinders.

Further areas of applicability of the present disclosure will becomeapparent from the detailed description, the claims and the drawings. Thedetailed description and specific examples are intended for purposes ofillustration only and are not intended to limit the scope of thedisclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure will become more fully understood from thedetailed description and the accompanying drawings, wherein:

FIG. 1 is a functional block diagram of an example engine systemaccording to the present disclosure;

FIG. 2 is a functional block diagram of an example engine control systemaccording to the present disclosure;

FIGS. 3A-3B are functional block diagrams of example air control modulesaccording to the present disclosure;

FIG. 4 includes a flowchart depicting an example method of controlling athrottle valve, intake and exhaust valve phasing, a wastegate, and anexhaust gas recirculation (EGR) valve using model predictive controlaccording to the present disclosure;

FIG. 5 is a functional block diagram of an example constraint settingsystem according to the present disclosure;

FIG. 6 is a flowchart depicting an example method of setting an actuatorconstraint and controlling an engine actuator based on the constraintaccording to the present disclosure;

FIG. 7 is a functional block diagram of an example fuel system accordingto the present disclosure;

FIG. 8 is a functional block diagram of an example vacuum and setpointcontrol system according to the present disclosure; and

FIGS. 9-10 are flowcharts of example methods of selectively adjustingone or more of setpoints input to a model predictive controlleraccording to the present disclosure.

In the drawings, reference numbers may be reused to identify similarand/or identical elements.

DETAILED DESCRIPTION

An engine control module (ECM) controls torque output of an engine. Morespecifically, the ECM controls actuators of the engine based on targetvalues, respectively, to produce a requested amount of torque. Forexample, the ECM controls intake and exhaust camshaft phasing based ontarget intake and exhaust phaser angles, a throttle valve based on atarget throttle opening, an exhaust gas recirculation (EGR) valve basedon a target EGR opening, and a wastegate of a turbocharger based on atarget wastegate duty cycle.

The ECM could determine the target values individually using multiplesingle input single output (SISO) controllers, such as proportionalintegral derivative (PID) controllers. However, when multiple SISOcontrollers are used, the target values may be set to maintain systemstability at the expense of possible fuel consumption decreases.Additionally, calibration and design of the individual SISO controllersmay be costly and time consuming.

The ECM of the present disclosure generates the target values usingmodel predictive control (MPC). More specifically, the ECM generatesvarious engine air and exhaust setpoints, such as an intake manifoldpressure setpoint, an air per cylinder (APC) setpoint, external andresidual dilution setpoints, and a compression ratio setpoint. Invarious implementations, intake and exhaust phasing setpoints may begenerated and used in place of the external and residual dilutionsetpoints.

The ECM identifies possible sets of target values for achieving thesetpoints. The ECM determines predicted parameters (responses) for eachof the possible sets based on the possible sets' target values and amodel of the engine. Constraints are also accounted for. The ECMdetermines a cost associated with use of each of the possible sets basedon comparisons of the predicted parameters with the setpoints,respectively. For example, the ECM may determine the cost associatedwith a possible set based on how quickly the predicted parameters reachthe setpoints and/or how far the predicted parameters overshoot thesetpoints, respectively. The ECM may select the one of the possible setshaving the lowest cost, and set the target values using the targetvalues of the selected possible set.

Referring now to FIG. 1, a functional block diagram of an example enginesystem 100 is presented. The engine system 100 includes an engine 102that combusts an air/fuel mixture to produce drive torque for a vehiclebased on driver input from a driver input module 104. The engine 102 maybe a gasoline spark ignition internal combustion engine.

Air is drawn into an intake manifold 110 through a throttle valve 112.For example only, the throttle valve 112 may include a butterfly valvehaving a rotatable blade. An engine control module (ECM) 114 controls athrottle actuator module 116, which regulates opening of the throttlevalve 112 to control the amount of air drawn into the intake manifold110.

Air from the intake manifold 110 is drawn into cylinders of the engine102. While the engine 102 may include multiple cylinders, forillustration purposes a single representative cylinder 118 is shown. Forexample only, the engine 102 may include 2, 3, 4, 5, 6, 8, 10, and/or 12cylinders. The ECM 114 may instruct a cylinder actuator module 120 toselectively deactivate some of the cylinders, which may improve fueleconomy under certain engine operating conditions.

The engine 102 may operate using a four-stroke cycle. The four strokes,described below, may be referred to as the intake stroke, thecompression stroke, the combustion stroke, and the exhaust stroke.During each revolution of a crankshaft (not shown), two of the fourstrokes occur within the cylinder 118. Therefore, two crankshaftrevolutions are necessary for the cylinder 118 to experience all four ofthe strokes.

During the intake stroke, air from the intake manifold 110 is drawn intothe cylinder 118 through an intake valve 122. The ECM 114 controls afuel actuator module 124, which regulates fuel injection to achieve atarget air/fuel ratio. Fuel may be injected into the intake manifold 110at a central location or at multiple locations, such as near the intakevalve 122 of each of the cylinders. In various implementations (notshown), fuel may be injected directly into the cylinders or into mixingchambers associated with the cylinders. The fuel actuator module 124 mayhalt injection of fuel to cylinders that are deactivated.

The injected fuel mixes with air and creates an air/fuel mixture in thecylinder 118. During the compression stroke, a piston (not shown) withinthe cylinder 118 compresses the air/fuel mixture. A spark actuatormodule 126 energizes a spark plug 128 in the cylinder 118 based on asignal from the ECM 114, which ignites the air/fuel mixture. The timingof the spark may be specified relative to the time when the piston is atits topmost position, referred to as top dead center (TDC).

The spark actuator module 126 may be controlled by a timing signalspecifying how far before or after TDC to generate the spark. Becausepiston position is directly related to crankshaft rotation, operation ofthe spark actuator module 126 may be synchronized with crankshaft angle.Generating spark may be referred to as a firing event. The sparkactuator module 126 may have the ability to vary the timing of the sparkfor each firing event. The spark actuator module 126 may vary the sparktiming for a next firing event when the spark timing is changed betweena last firing event and the next firing event. The spark actuator module126 may halt provision of spark to deactivated cylinders.

During the combustion stroke, the combustion of the air/fuel mixturedrives the piston away from TDC, thereby driving the crankshaft. Thecombustion stroke may be defined as the time between the piston reachingTDC and the time at which the piston reaches bottom dead center (BDC).During the exhaust stroke, the piston begins moving away from BDC andexpels the byproducts of combustion through an exhaust valve 130. Thebyproducts of combustion are exhausted from the vehicle via an exhaustsystem 134.

The intake valve 122 may be controlled by an intake camshaft 140, whilethe exhaust valve 130 may be controlled by an exhaust camshaft 142. Invarious implementations, multiple intake camshafts (including the intakecamshaft 140) may control multiple intake valves (including the intakevalve 122) for the cylinder 118 and/or may control the intake valves(including the intake valve 122) of multiple banks of cylinders(including the cylinder 118). Similarly, multiple exhaust camshafts(including the exhaust camshaft 142) may control multiple exhaust valvesfor the cylinder 118 and/or may control exhaust valves (including theexhaust valve 130) for multiple banks of cylinders (including thecylinder 118). In various other implementations, the intake valve 122and/or the exhaust valve 130 may be controlled by devices other thancamshafts, such as camless valve actuators. The cylinder actuator module120 may deactivate the cylinder 118 by disabling opening of the intakevalve 122 and/or the exhaust valve 130.

The time when the intake valve 122 is opened may be varied with respectto piston TDC by an intake cam phaser 148. The time when the exhaustvalve 130 is opened may be varied with respect to piston TDC by anexhaust cam phaser 150. A phaser actuator module 158 may control theintake cam phaser 148 and the exhaust cam phaser 150 based on signalsfrom the ECM 114. When implemented, variable valve lift (not shown) mayalso be controlled by the phaser actuator module 158.

The engine system 100 may include a turbocharger that includes a hotturbine 160-1 that is powered by hot exhaust gases flowing through theexhaust system 134. The turbocharger also includes a cold air compressor160-2 that is driven by the turbine 160-1. The compressor 160-2compresses air leading into the throttle valve 112. In variousimplementations, a supercharger (not shown), driven by the crankshaft,may compress air from the throttle valve 112 and deliver the compressedair to the intake manifold 110.

A wastegate 162 may allow exhaust to bypass the turbine 160-1, therebyreducing the boost (the amount of intake air compression) provided bythe turbocharger. A boost actuator module 164 may control the boost ofthe turbocharger by controlling opening of the wastegate 162. In variousimplementations, two or more turbochargers may be implemented and may becontrolled by the boost actuator module 164.

An air cooler (not shown) may transfer heat from the compressed aircharge to a cooling medium, such as engine coolant or air. An air coolerthat cools the compressed air charge using engine coolant may bereferred to as an intercooler. An air cooler that cools the compressedair charge using air may be referred to as a charge air cooler. Thecompressed air charge may receive heat, for example, via compressionand/or from components of the exhaust system 134. Although shownseparated for purposes of illustration, the turbine 160-1 and thecompressor 160-2 may be attached to each other, placing intake air inclose proximity to hot exhaust.

The engine system 100 may include an exhaust gas recirculation (EGR)valve 170, which selectively redirects exhaust gas back to the intakemanifold 110. The EGR valve 170 may be located upstream of theturbocharger's turbine 160-1. The EGR valve 170 may be controlled by anEGR actuator module 172 based on signals from the ECM 114.

A position of the crankshaft may be measured using a crankshaft positionsensor 180. A rotational speed of the crankshaft (an engine speed) maybe determined based on the crankshaft position. A temperature of theengine coolant may be measured using an engine coolant temperature (ECT)sensor 182. The ECT sensor 182 may be located within the engine 102 orat other locations where the coolant is circulated, such as a radiator(not shown).

A pressure within the intake manifold 110 may be measured using amanifold absolute pressure (MAP) sensor 184. In various implementations,engine vacuum, which is the difference between ambient air pressure andthe pressure within the intake manifold 110, may be measured. A massflow rate of air flowing into the intake manifold 110 may be measuredusing a mass air flow (MAF) sensor 186. In various implementations, theMAF sensor 186 may be located in a housing that also includes thethrottle valve 112.

The throttle actuator module 116 may monitor the position of thethrottle valve 112 using one or more throttle position sensors (TPS)190. An ambient temperature of air being drawn into the engine 102 maybe measured using an intake air temperature (IAT) sensor 192. The enginesystem 100 may also include one or more other sensors 193, such as anambient humidity sensor, one or more knock sensors, a compressor outletpressure sensor and/or a throttle inlet pressure sensor, a wastegateposition sensor, an EGR position sensor, and/or one or more othersuitable sensors. The ECM 114 may use signals from the sensors to makecontrol decisions for the engine system 100.

The ECM 114 may communicate with a transmission control module 194 tocoordinate shifting gears in a transmission (not shown). For example,the ECM 114 may reduce engine torque during a gear shift. The ECM 114may communicate with a hybrid control module 196 to coordinate operationof the engine 102 and an electric motor 198.

The electric motor 198 may also function as a generator, and may be usedto produce electrical energy for use by vehicle electrical systemsand/or for storage in a battery. In various implementations, variousfunctions of the ECM 114, the transmission control module 194, and thehybrid control module 196 may be integrated into one or more modules.

Each system that varies an engine parameter may be referred to as anengine actuator. For example, the throttle actuator module 116 mayadjust opening of the throttle valve 112 to achieve a target throttleopening area. The spark actuator module 126 controls the spark plugs toachieve a target spark timing relative to piston TDC. The fuel actuatormodule 124 controls the fuel injectors to achieve target fuelingparameters. The phaser actuator module 158 may control the intake andexhaust cam phasers 148 and 150 to achieve target intake and exhaust camphaser angles, respectively. The EGR actuator module 172 may control theEGR valve 170 to achieve a target EGR opening area. The boost actuatormodule 164 controls the wastegate 162 to achieve a target wastegateopening area. The cylinder actuator module 120 controls cylinderdeactivation to achieve a target number of activated or deactivatedcylinders.

The ECM 114 generates the target values for the engine actuators tocause the engine 102 to generate a target engine output torque. The ECM114 generates the target values for the engine actuators using modelpredictive control, as discussed further below.

Referring now to FIG. 2, a functional block diagram of an example enginecontrol system is presented. An example implementation of the ECM 114includes a driver torque module 202, an axle torque arbitration module204, and a propulsion torque arbitration module 206. The ECM 114 mayinclude a hybrid optimization module 208. The ECM 114 also includes areserves/loads module 220, a torque requesting module 224, an aircontrol module 228, a spark control module 232, a cylinder controlmodule 236, and a fuel control module 240.

The driver torque module 202 may determine a driver torque request 254based on a driver input 255 from the driver input module 104. The driverinput 255 may be based on, for example, a position of an acceleratorpedal and a position of a brake pedal. The driver input 255 may also bebased on cruise control, which may be an adaptive cruise control systemthat varies vehicle speed to maintain a predetermined followingdistance. The driver torque module 202 may store one or more mappings ofaccelerator pedal position to target torque and may determine the drivertorque request 254 based on a selected one of the mappings.

An axle torque arbitration module 204 arbitrates between the drivertorque request 254 and other axle torque requests 256. Axle torque(torque at the wheels) may be produced by various sources including anengine and/or an electric motor. For example, the axle torque requests256 may include a torque reduction requested by a traction controlsystem when positive wheel slip is detected. Positive wheel slip occurswhen axle torque overcomes friction between the wheels and the roadsurface, and the wheels begin to slip against the road surface. The axletorque requests 256 may also include a torque increase request tocounteract negative wheel slip, where a tire of the vehicle slips in theother direction with respect to the road surface because the axle torqueis negative.

The axle torque requests 256 may also include brake management requestsand vehicle over-speed torque requests. Brake management requests mayreduce axle torque to ensure that the axle torque does not exceed theability of the brakes to hold the vehicle when the vehicle is stopped.Vehicle over-speed torque requests may reduce the axle torque to preventthe vehicle from exceeding a predetermined speed. The axle torquerequests 256 may also be generated by vehicle stability control systems.

The axle torque arbitration module 204 outputs a predicted torquerequest 257 and an immediate torque request 258 based on the results ofarbitrating between the received torque requests 254 and 256. Asdescribed below, the predicted and immediate torque requests 257 and 258from the axle torque arbitration module 204 may selectively be adjustedby other modules of the ECM 114 before being used to control the engineactuators.

In general terms, the immediate torque request 258 may be an amount ofcurrently desired axle torque, while the predicted torque request 257may be an amount of axle torque that may be needed on short notice. TheECM 114 controls the engine system 100 to produce an axle torque equalto the immediate torque request 258. However, different combinations oftarget values may result in the same axle torque. The ECM 114 maytherefore adjust the target values to enable a faster transition to thepredicted torque request 257, while still maintaining the axle torque atthe immediate torque request 258.

In various implementations, the predicted torque request 257 may be setbased on the driver torque request 254. The immediate torque request 258may be set to less than the predicted torque request 257 under somecircumstances, such as when the driver torque request 254 is causingwheel slip on an icy surface. In such a case, a traction control system(not shown) may request a reduction via the immediate torque request258, and the ECM 114 reduces the engine torque output to the immediatetorque request 258. However, the ECM 114 performs the reduction so theengine system 100 can quickly resume producing the predicted torquerequest 257 once the wheel slip stops.

In general terms, the difference between the immediate torque request258 and the (generally higher) predicted torque request 257 can bereferred to as a torque reserve. The torque reserve may represent theamount of additional torque (above the immediate torque request 258)that the engine system 100 can begin to produce with minimal delay. Fastengine actuators are used to increase or decrease current axle torquewith minimal delay. Fast engine actuators are defined in contrast withslow engine actuators.

In general terms, fast engine actuators can change the axle torque morequickly than slow engine actuators. Slow actuators may respond moreslowly to changes in their respective target values than fast actuatorsdo. For example, a slow actuator may include mechanical components thatrequire time to move from one position to another in response to achange in target value. A slow actuator may also be characterized by theamount of time it takes for the axle torque to begin to change once theslow actuator begins to implement the changed target value. Generally,this amount of time will be longer for slow actuators than for fastactuators. In addition, even after beginning to change, the axle torquemay take longer to fully respond to a change in a slow actuator.

For example only, the spark actuator module 126 may be a fast actuator.Spark-ignition engines may combust fuels including, for example,gasoline and ethanol, by applying a spark. By way of contrast, thethrottle actuator module 116 may be a slow actuator.

For example, as described above, the spark actuator module 126 can varythe spark timing for a next firing event when the spark timing ischanged between a last firing event and the next firing event. By way ofcontrast, changes in throttle opening take longer to affect engineoutput torque. The throttle actuator module 116 changes the throttleopening by adjusting the angle of the blade of the throttle valve 112.Therefore, when the target value for opening of the throttle valve 112is changed, there is a mechanical delay as the throttle valve 112 movesfrom its previous position to a new position in response to the change.In addition, air flow changes based on the throttle opening are subjectto air transport delays in the intake manifold 110. Further, increasedair flow in the intake manifold 110 is not realized as an increase inengine output torque until the cylinder 118 receives additional air inthe next intake stroke, compresses the additional air, and commences thecombustion stroke.

Using these actuators as an example, a torque reserve can be created bysetting the throttle opening to a value that would allow the engine 102to produce the predicted torque request 257. Meanwhile, the spark timingcan be set based on the immediate torque request 258, which is less thanthe predicted torque request 257. Although the throttle openinggenerates enough air flow for the engine 102 to produce the predictedtorque request 257, the spark timing is retarded (which reduces torque)based on the immediate torque request 258. The engine output torque willtherefore be equal to the immediate torque request 258.

When additional torque is needed, the spark timing can be set based onthe predicted torque request 257 or a torque between the predicted andimmediate torque requests 257 and 258. By the following firing event,the spark actuator module 126 may return the spark timing to an optimumvalue, which allows the engine 102 to produce the full engine outputtorque achievable with the air flow already present. The engine outputtorque may therefore be quickly increased to the predicted torquerequest 257 without experiencing delays from changing the throttleopening.

The axle torque arbitration module 204 may output the predicted torquerequest 257 and the immediate torque request 258 to a propulsion torquearbitration module 206. In various implementations, the axle torquearbitration module 204 may output the predicted and immediate torquerequests 257 and 258 to the hybrid optimization module 208.

The hybrid optimization module 208 may determine how much torque shouldbe produced by the engine 102 and how much torque should be produced bythe electric motor 198. The hybrid optimization module 208 then outputsmodified predicted and immediate torque requests 259 and 260,respectively, to the propulsion torque arbitration module 206. Invarious implementations, the hybrid optimization module 208 may beimplemented in the hybrid control module 196.

The predicted and immediate torque requests received by the propulsiontorque arbitration module 206 are converted from an axle torque domain(torque at the wheels) into a propulsion torque domain (torque at thecrankshaft). This conversion may occur before, after, as part of, or inplace of the hybrid optimization module 208.

The propulsion torque arbitration module 206 arbitrates betweenpropulsion torque requests 290, including the converted predicted andimmediate torque requests. The propulsion torque arbitration module 206generates an arbitrated predicted torque request 261 and an arbitratedimmediate torque request 262. The arbitrated torque requests 261 and 262may be generated by selecting a winning request from among receivedtorque requests. Alternatively or additionally, the arbitrated torquerequests may be generated by modifying one of the received requestsbased on another one or more of the received torque requests.

For example, the propulsion torque requests 290 may include torquereductions for engine over-speed protection, torque increases for stallprevention, and torque reductions requested by the transmission controlmodule 194 to accommodate gear shifts. The propulsion torque requests290 may also result from clutch fuel cutoff, which reduces the engineoutput torque when the driver depresses the clutch pedal in a manualtransmission vehicle to prevent a flare (rapid rise) in engine speed.

The propulsion torque requests 290 may also include an engine shutoffrequest, which may be initiated when a critical fault is detected. Forexample only, critical faults may include detection of vehicle theft, astuck starter motor, electronic throttle control problems, andunexpected torque increases. In various implementations, when an engineshutoff request is present, arbitration selects the engine shutoffrequest as the winning request. When the engine shutoff request ispresent, the propulsion torque arbitration module 206 may output zero asthe arbitrated predicted and immediate torque requests 261 and 262.

In various implementations, an engine shutoff request may simply shutdown the engine 102 separately from the arbitration process. Thepropulsion torque arbitration module 206 may still receive the engineshutoff request so that, for example, appropriate data can be fed backto other torque requestors. For example, all other torque requestors maybe informed that they have lost arbitration.

The reserves/loads module 220 receives the arbitrated predicted andimmediate torque requests 261 and 262. The reserves/loads module 220 mayadjust the arbitrated predicted and immediate torque requests 261 and262 to create a torque reserve and/or to compensate for one or moreloads. The reserves/loads module 220 then outputs adjusted predicted andimmediate torque requests 263 and 264 to the torque requesting module224.

For example only, a catalyst light-off process or a cold start emissionsreduction process may require retarded spark timing. The reserves/loadsmodule 220 may therefore increase the adjusted predicted torque request263 above the adjusted immediate torque request 264 to create retardedspark for the cold start emissions reduction process. In anotherexample, the air/fuel ratio of the engine and/or the mass air flow maybe directly varied, such as by diagnostic intrusive equivalence ratiotesting and/or new engine purging. Before beginning these processes, atorque reserve may be created or increased to quickly offset decreasesin engine output torque that result from leaning the air/fuel mixtureduring these processes.

The reserves/loads module 220 may also create or increase a torquereserve in anticipation of a future load, such as power steering pumpoperation or engagement of an air conditioning (A/C) compressor clutch.The reserve for engagement of the A/C compressor clutch may be createdwhen the driver first requests air conditioning. The reserves/loadsmodule 220 may increase the adjusted predicted torque request 263 whileleaving the adjusted immediate torque request 264 unchanged to producethe torque reserve. Then, when the NC compressor clutch engages, thereserves/loads module 220 may increase the adjusted immediate torquerequest 264 by the estimated load of the NC compressor clutch.

The torque requesting module 224 receives the adjusted predicted andimmediate torque requests 263 and 264. The torque requesting module 224determines how the adjusted predicted and immediate torque requests 263and 264 will be achieved. The torque requesting module 224 may be enginetype specific. For example, the torque requesting module 224 may beimplemented differently or use different control schemes forspark-ignition engines versus compression-ignition engines.

In various implementations, the torque requesting module 224 may definea boundary between modules that are common across all engine types andmodules that are engine type specific. For example, engine types mayinclude spark-ignition and compression-ignition. Modules prior to thetorque requesting module 224, such as the propulsion torque arbitrationmodule 206, may be common across engine types, while the torquerequesting module 224 and subsequent modules may be engine typespecific.

The torque requesting module 224 determines an air torque request 265based on the adjusted predicted and immediate torque requests 263 and264. The air torque request 265 may be a brake torque. Brake torque mayrefer to torque at the crankshaft under the current operatingconditions.

Target values for airflow controlling engine actuators are determinedbased on the air torque request 265. More specifically, based on the airtorque request 265, the air control module 228 determines a targetwastegate opening area 266, a target throttle opening area 267, a targetEGR opening area 268, a target intake cam phaser angle 269, and a targetexhaust cam phaser angle 270. The air control module 228 determines thetarget wastegate opening area 266, the target throttle opening area 267,the target EGR opening area 268, the target intake cam phaser angle 269,and the target exhaust cam phaser angle 270 using model predictivecontrol, as discussed further below.

The boost actuator module 164 controls the wastegate 162 to achieve thetarget wastegate opening area 266. For example, a first conversionmodule 272 may convert the target wastegate opening area 266 into atarget duty cycle 274 to be applied to the wastegate 162, and the boostactuator module 164 may apply a signal to the wastegate 162 based on thetarget duty cycle 274. In various implementations, the first conversionmodule 272 may convert the target wastegate opening area 266 into atarget wastegate position (not shown), and convert the target wastegateposition into the target duty cycle 274.

The throttle actuator module 116 controls the throttle valve 112 toachieve the target throttle opening area 267. For example, a secondconversion module 276 may convert the target throttle opening area 267into a target duty cycle 278 to be applied to the throttle valve 112,and the throttle actuator module 116 may apply a signal to the throttlevalve 112 based on the target duty cycle 278. In variousimplementations, the second conversion module 276 may convert the targetthrottle opening area 267 into a target throttle position (not shown),and convert the target throttle position into the target duty cycle 278.

The EGR actuator module 172 controls the EGR valve 170 to achieve thetarget EGR opening area 268. For example, a third conversion module 280may convert the target EGR opening area 268 into a target duty cycle 282to be applied to the EGR valve 170, and the EGR actuator module 172 mayapply a signal to the EGR valve 170 based on the target duty cycle 282.In various implementations, the third conversion module 280 may convertthe target EGR opening area 268 into a target EGR position (not shown),and convert the target EGR position into the target duty cycle 282.

The phaser actuator module 158 controls the intake cam phaser 148 toachieve the target intake cam phaser angle 269. The phaser actuatormodule 158 also controls the exhaust cam phaser 150 to achieve thetarget exhaust cam phaser angle 270. In various implementations, afourth conversion module (not shown) may be included and may convert thetarget intake and exhaust cam phaser angles into target target intakeand exhaust duty cycles, respectively. The phaser actuator module 158may apply the target intake and exhaust duty cycles to the intake andexhaust cam phasers 148 and 150, respectively.

The torque requesting module 224 may also generate a spark torquerequest 283, a cylinder shut-off torque request 284, and a fuel torquerequest 285 based on the predicted and immediate torque requests 263 and264. The spark control module 232 may determine how much to retard thespark timing (which reduces engine output torque) from an optimum sparktiming based on the spark torque request 283. For example only, a torquerelationship may be inverted to solve for a target spark timing 286. Fora given torque request (T_(Req)), the target spark timing (S_(T)) 286may be determined based on:S _(T) =f ⁻¹(T _(Req) ,APC,I,E,AF,OT,#).  (1)This relationship may be embodied as an equation and/or as a lookuptable. The air/fuel ratio (AF) may be the actual air/fuel ratio, asreported by the fuel control module 240.

When the spark timing is set to the optimum spark timing, the resultingtorque may be as close to a maximum best torque (MBT) as possible. MBTrefers to the maximum engine output torque that is generated for a givenair flow as spark timing is advanced, while using fuel having an octanerating greater than a predetermined octane rating and usingstoichiometric fueling. The spark timing at which this maximum torqueoccurs is referred to as an MBT spark timing. The optimum spark timingmay differ slightly from MBT spark timing because of, for example, fuelquality (such as when lower octane fuel is used) and environmentalfactors, such as ambient humidity and temperature. The engine outputtorque at the optimum spark timing may therefore be less than MBT. Forexample only, a table of optimum spark timings corresponding todifferent engine operating conditions may be determined during acalibration phase of vehicle design, and the optimum value is determinedfrom the table based on current engine operating conditions.

The cylinder shut-off torque request 284 may be used by the cylindercontrol module 236 to determine a target number of cylinders todeactivate 287. In various implementations, a target number of cylindersto activate may be used. The cylinder actuator module 120 selectivelyactivates and deactivates the valves of cylinders based on the targetnumber 287.

The cylinder control module 236 may also instruct the fuel controlmodule 240 to stop providing fuel for deactivated cylinders and mayinstruct the spark control module 232 to stop providing spark fordeactivated cylinders. The spark control module 232 may stop providingspark to a cylinder once an fuel/air mixture that is already present inthe cylinder has been combusted.

The fuel control module 240 may vary the amount of fuel provided to eachcylinder based on the fuel torque request 285. More specifically, thefuel control module 240 may generate target fueling parameters 288 basedon the fuel torque request 285. The target fueling parameters 288 mayinclude, for example, target mass of fuel, target injection startingtiming, and target number of fuel injections.

During normal operation, the fuel control module 240 may operate in anair lead mode in which the fuel control module 240 attempts to maintaina stoichiometric air/fuel ratio by controlling fueling based on airflow. For example, the fuel control module 240 may determine a targetfuel mass that will yield stoichiometric combustion when combined with apresent mass of air per cylinder (APC).

FIGS. 3A-3B are functional block diagrams of example implementations ofthe air control module 228. Referring now to FIGS. 2, 3A, and 3B, asdiscussed above, the air torque request 265 may be a brake torque. Atorque conversion module 304 converts the air torque request 265 frombrake torque into base torque. The torque request resulting fromconversion into base torque will be referred to as a base air torquerequest 308.

Base torques may refer to torque at the crankshaft made during operationof the engine 102 on a dynamometer while the engine 102 is warm and notorque loads are imposed on the engine 102 by accessories, such as analternator and the A/C compressor. The torque conversion module 304 mayconvert the air torque request 265 into the base air torque request 308,for example, using a mapping or a function that relates brake torques tobase torques.

In various implementations, the torque conversion module 304 may convertthe air torque request 265 into another type of torque that is suitablefor use by a setpoint module 312, such as an indicated torque. Anindicated torque may refer to a torque at the crankshaft attributable towork produced via combustion within the cylinders.

The setpoint module 312 generates setpoint values for controlling thethrottle valve 112, the EGR valve 170, the wastegate 162, the intake camphaser 148, and the exhaust cam phaser 150 to achieve the base airtorque request 308 at a present engine speed 316. The setpoints may bereferred to as engine air and exhaust setpoints. The engine speed 316may be determined, for example, based on a crankshaft position measuredusing the crankshaft position sensor 180.

For example, as in FIG. 3A, the setpoint module 312 may generate amanifold pressure (e.g., a MAP) setpoint 318, a mass of air per cylinder(APC) setpoint 320, an external dilution setpoint 324, a residualdilution setpoint 328, and an effective compression ratio setpoint 332.The setpoint module 312 may generate the manifold pressure setpoint 318,the APC setpoint 320, the external dilution setpoint 324, the residualdilution setpoint 328, and the effective compression ratio setpoint 332using one or more functions or mappings that relate the base air torquerequest 308 and the engine speed 316 to the setpoints 318-332. Thesetpoint module 312 may also generate one or more other setpoints basedon the base air torque request 308 and the engine speed 316.

The manifold pressure setpoint 318 may refer to a target pressure withinthe intake manifold 110. The APC setpoint 320 may refer to a target massof air to be drawn into a cylinder for a combustion event. An effectivecompression ratio may also be referred to as a dynamic compressionratio.

Dilution may refer to an amount of exhaust from a prior combustion eventtrapped within a cylinder for a combustion event. External dilution mayrefer to exhaust provided for a combustion event via the EGR valve 170.Internal dilution may refer to exhaust that remains in a cylinder and/orexhaust that is pushed back into the cylinder following the exhauststroke of a combustion cycle. The external dilution setpoint 324 mayrefer to a target amount of external dilution. The internal dilutionsetpoint 328 may refer to a target amount of internal dilution.

As in FIG. 3B, the setpoint module 312 may generate a mass of air percylinder (APC) setpoint 380, an EGR setpoint 384, an intake cam phasingsetpoint 388, and an exhaust cam phasing setpoint 392. The setpointmodule 312 may generate the APC setpoint 380, the EGR setpoint 384, theintake cam phasing setpoint 388, and the exhaust cam phasing setpoint392 using one or more functions or mappings that relate the base airtorque request 308 and the engine speed 316 to the setpoints 380-392.The setpoint module 312 may also generate one or more other setpointsbased on the base air torque request 308 and the engine speed 316.

The APC setpoint 380 may refer to a target mass of air to be drawn intoa cylinder for a combustion event. The EGR setpoint 384 may refer to,for example, a target mass fraction of EGR to be drawn into the cylinderfor the combustion event or an EGR mass flow rate back to the intakemanifold 110. A mass fraction of EGR may refer to a ratio of a massfraction of EGR to the (total) mass of a gas charge of a combustionevent. The intake and exhaust cam phasing setpoints 388 and 392 mayrefer to target positions (phasing) of the intake and exhaust camphasers 18 and 150, respectively.

Referring now to FIGS. 2, 3A, and 3B, while the following descriptionwill be made with reference to the setpoints 318-332, the setpoints380-392 may be used.

The setpoint module 312 may generate one or more of the setpoints318-332 further based on desired combustion phasing 336 and a cylindermode 340. The cylinder mode 340 may refer to, for example, the number ofcylinders that are deactivated (or activated) and/or a mode of operationof the engine 102 where one or more cylinders (e.g., half or anotherfraction) are deactivated.

When one or more cylinders are deactivated, each cylinder that isactivated is responsible for producing a greater amount of torque inorder to achieve the base air torque request 308. The setpoint module312 may therefore adjust one or more of the setpoints 318-332 based onthe cylinder mode 340. For example, the setpoint module 312 may increasethe APC setpoint 320 based on the cylinder mode 340. The setpoint module312 may additionally or alternatively adjust one or more of the othersetpoints 318-332 based on the cylinder mode 340.

Combustion phasing may refer to a crankshaft position where apredetermined amount of injected fuel is combusted within a cylinderrelative to a predetermined crankshaft position for combustion of thepredetermined amount of injected fuel. For example, combustion phasingmay be expressed in terms of CA50 relative to a predetermined CA50. CA50may refer to a crankshaft position (or angle, hence CA) where 50 percentof a mass of injected fuel has been combusted within a cylinder. Thepredetermined CA50 may correspond to a CA50 where a maximum amount ofwork is produced from the fuel injected and may be approximately8.5-approximately 10 degrees after TDC.

A combustion phasing module 344 (FIG. 2) may generally set the desiredcombustion phasing 336 such that the CA50 occurs at the predeterminedCA50. In other words, the combustion phasing module 344 may generallyset the desired combustion phasing 336 such that zero combustion phasingoccurs to achieve the maximum work and therefore a maximum fuelefficiency. However, the combustion phasing module 344 may selectivelyadjust the desired combustion phasing 336 under some circumstances.

For example, the combustion phasing module 344 may set the desiredcombustion phasing such that the CA50 occurs after the predeterminedCA50 when knock is detected. Knock may be detected, for example, usingone or more knock sensors. Additionally or alternatively, the combustionphasing module 344 may set the desired combustion phasing such that theCA50 occurs after the predetermined CA50 when one or more conditions arepresent that may cause knock to occur. For example, knock may occur whena quality of fuel within a fuel tank of the vehicle is less than apredetermined quality and/or the ambient temperature is greater than apredetermined temperature and ambient humidity is less than apredetermined value.

When combustion is retarded such that the CA50 occurs after thepredetermined CA50, airflow into the cylinders should be increased toachieve the base air torque request 308. The setpoint module 312 maytherefore adjust one or more of the setpoints 318-332 based on thedesired combustion phasing 336. For example, the setpoint module 312 mayincrease the APC setpoint 320 when the desired combustion phasing 336 isretarded to provide a CA50 that is after the predetermined CA50.

The setpoint module 312 also generates the setpoints 318-332 based onone or more setpoint constraints 348. A constraint setting module 352may set the setpoint constraints 348 for the setpoints 318-332 topredetermined acceptable ranges, respectively. The setpoint module 312sets the setpoints 318-332 to remain within the setpoint constraints348, respectively.

However, the constraint setting module 352 may selectively adjust asetpoint constraint under some circumstances. For example only, theconstraint setting module 352 may set a setpoint constraint to disabledilution. The setpoint module 312 may limit the external dilutionsetpoint 324 and the residual dilution setpoint 328 to zero in responsethe setpoint constraint to disable dilution.

The setpoint module 312 may also adjust one or more of the othersetpoints based on the limitation of a setpoint. For example, thesetpoint module 312 may increase the APC setpoint 320 in order toachieve the base air torque request 308 when the external and residualdilution setpoints 324 and 328 are limited.

A model predictive control (MPC) module 360 generates the target values266-270, subject to actuator constraints 364, based on the setpoints318-332, sensed values 368, actual combustion phasing 372, and a model376 of the engine 102, using MPC. MPC involves the MPC module 360identifying possible sequences of the target values 266-270 that couldbe used together during N future control loops, subject to the actuatorconstraints 364, and given the sensed values 368 and the actualcombustion phasing 372, to achieve the setpoints 318-332.

Each possible sequence includes one sequence of N values for each of thetarget values 266-270. In other words, each possible sequence includes asequence of N values for the target wastegate opening area 266, asequence of N values for the target throttle opening area 267, asequence of N values for the target EGR opening area 268, a sequence ofN values for the target intake cam phaser angle 269, and a sequence of Nvalues for the target exhaust cam phaser angle 270. Each of the N valuesare for a corresponding one of the N control loops.

The MPC module 360 determines predicted responses of the engine 102 tothe identified possible sequences of the target values 266-270,respectively, using the model 376 of the engine 102. The MPC module 360generates a prediction for parameters corresponding to the setpoints318-332 based on a given possible sequence of the target values 266-270.More specifically, based on a given possible sequence of the targetvalues 266-270, using the model 376, the MPC module 360 generates asequence of predicted manifold pressures for the N control loops, asequence of predicted APCs for the N control loops, a sequence ofpredicted amounts of external dilution for the N control loops, asequence of predicted amounts of residual dilution for the N controlloops, and a sequence of predicted compression ratios for the N controlloops. The model 376 may be, for example, a function or a mappingcalibrated based on characteristics of the engine 102.

The MPC module 360 determines a cost for each of the possible sequencesof the target values 266-270 based on relationships between thesetpoints 318-332 and the predictions, respectively. For example, theMPC module 360 may determine the cost for each of the possible sequencesof the target values 266-270 based on the periods for the predictedparameters to reach the setpoints 318-332, respectively, and/or amountsthat the predicted parameters overshoot the setpoints 318-332,respectively. For example only, the cost may increase as the period fora predicted parameter to reach a setpoint increases and/or as the amountthat the predicted parameter overshoots the setpoint increases.

Each pair of predicted parameters and setpoints may be weighted toaffect how much the relationships between the predicted parameters andthe setpoints affects the cost. For example, the relationship betweenthe predicted APC and the APC setpoint 320 maybe weighted to affect thecost more than the relationship between another predicted parameter andthe corresponding setpoint. The relationship between the predicted APCand the APC setpoint 320 may be weighted to affect the cost more becauseAPC is most closely related to engine torque production. Weighting therelationship between the predicted APC and the APC setpoint 320 toaffect the cost more may therefore enable satisfaction of changes in thebase air torque request 308.

The MPC module 360 selects one of the possible sequences of the targetvalues 266-270 based on the costs of the possible sequences of thetarget values 266-270. For example, the MPC module 360 may select theone of the possible sequences having the lowest cost.

The MPC module 360 may then set the target values 266-270 to the firstones of the N values of the selected possible sequence, respectively. Inother words, the MPC module 360 may set the target wastegate openingarea 266 to the first one of the N values in the sequence of N valuesfor the target wastegate opening area 266, set the target throttleopening area 267 to the first one of the N values in the sequence of Nvalues for the target throttle opening area 267, set the target EGRopening area 268 to the first one of the N values in the sequence of Nvalues for the target EGR opening area 268, set the target intake camphaser angle 269 to the first one of the N values in the sequence of Nvalues for the target intake cam phaser angle 269, and set the targetexhaust cam phaser angle 270 to the first one of the N values in thesequence of N values for the target exhaust cam phaser angle 270. Duringa next control loop, the MPC module 360 identifies possible sequences,generates the predicted responses of the possible sequences, determinesthe cost of each of the possible sequences, selects of one of thepossible sequences, and sets of the target values 266-270 to the firstset of the target values 266-270 in the selected possible sequence.

The constraint setting module 352 may set the actuator constraints 364.Generally, the constraint setting module 352 may set the actuatorconstraints 364 for the throttle valve 112, the EGR valve 170, thewastegate 162, the intake cam phaser 148, and the exhaust cam phaser 150to predetermined acceptable ranges, respectively. The MPC module 360identifies the possible sequences such that the target values 266-270remain within the actuator constraints 364, respectively.

However, the constraint setting module 352 may selectively adjust anactuator constraint under some circumstances. For example, theconstraint setting module 352 may adjust the actuator constraint for agiven engine actuator to narrow the range of possible targets for thatengine actuator when a fault is diagnosed in that engine actuator. Foranother example only, the constraint setting module 352 may adjust theactuator constraint such that the target value for a given actuatorfollows a predetermined schedule for a fault diagnostic, such as a camphaser fault diagnostic or an EGR diagnostic. The boundaries of a rangecan be set to the same value to cause a target value to be set to thatvalue, and the value used can be varied over time to cause the targetvalue to follow the predetermined schedule.

The sensed values 368 may be measured using sensors or determined basedon one or more values measured using one or more sensors. The actualcombustion phasing 372 may be determined, for example, based on theactual CA50 during a previous predetermined period relative to thepredetermined CA50. Retardation of the CA50 relative to thepredetermined CA50 during the predetermined period may indicate thatextra energy has been input to the exhaust system 134. The MPC module360 may therefore increase the target wastegate opening area 266 tooffset the extra energy in the exhaust system 134. Otherwise, the extraenergy may cause boost of the turbocharger to increase.

Referring now to FIG. 4, a flowchart depicting an example method ofcontrolling the throttle valve 112, the intake cam phaser 148, theexhaust cam phaser 150, the wastegate 162, and the EGR valve 170 usingMPC (model predictive control) is presented. Control may begin with 404where the torque requesting module 224 determines the air torque request265 based on the adjusted predicted and immediate torque requests 263and 264.

At 408, the torque conversion module 304 may convert the air torquerequest 265 into the base air torque request 308 or into another type oftorque suitable for use by the setpoint module 312. At 412, the setpointmodule 312 generates the setpoints 318-332 based on the base air torquerequest 308 and the engine speed 316, subject to the setpointconstraints 348. The setpoint module 312 may generate the setpoints318-332 further based on the cylinder mode 340 and/or the desiredcombustion phasing 336.

At 416, the MPC module 360 generates the target values 266-270 based onthe setpoints 318-332, subject to the actuator constraints 364, usingMPC. More specifically, as described above, the MPC module 360identifies possible sequences of the target values 266-270 and generatespredicted responses using the model 376. The MPC module 360 alsodetermines costs for the possible sequences based on the predictedresponses, selects one of the possible sequences based on the costs, andsets the target values 266-270 based on the first ones of the targetvalues in the selected possible sequence, respectively.

At 420, the first conversion module 272 converts the target wastegateopening area 266 into the target duty cycle 274 to be applied to thewastegate 162, the second conversion module 276 converts the targetthrottle opening area 267 into the target duty cycle 278 to be appliedto the throttle valve 112. The third conversion module 280 also convertsthe target EGR opening area 268 into the target duty cycle 282 to beapplied to the EGR valve 170 at 420. The fourth conversion module mayalso convert the target intake and exhaust cam phaser angles 269 and 270into the target intake and exhaust duty cycles to be applied to theintake and exhaust cam phasers 148 and 150, respectively.

At 424, the throttle actuator module 116 controls the throttle valve 112to achieve the target throttle opening area 267, and the phaser actuatormodule 158 controls the intake and exhaust cam phasers 148 and 150 toachieve the target intake and exhaust cam phaser angles 269 and 270,respectively. For example, the throttle actuator module 116 may apply asignal to the throttle valve 112 at the target duty cycle 278 to achievethe target throttle opening area 267. Also at 424, the EGR actuatormodule 172 controls the EGR valve 170 to achieve the target EGR openingarea 268, and the boost actuator module 164 controls the wastegate 162to achieve the target wastegate opening area 266. For example, the EGRactuator module 172 may apply a signal to the EGR valve 170 at thetarget duty cycle 282 to achieve the target EGR opening area 268, andthe boost actuator module 164 may apply a signal to the wastegate 162 atthe target duty cycle 274 to achieve the target wastegate opening area266. While FIG. 4 is shown as ending after 424, FIG. 4 may beillustrative of one control loop, and control loops may be executed at apredetermined rate.

Referring now to FIG. 5, a functional block diagram of a constraintsetting system is presented. The target values 266-270 are generallydetermined as discussed above. However, under some circumstances, one ormore of the target values 266-270 may need to be controlled in apredetermined way for one or more reasons. The constraint setting module352 may set the associated one or more of the actuator constraints 364such that the one or more of the target values 266-270 are controlled inthat way.

For example, one or more of the target values 266-270 may be controlledin a predetermined way in an effort to clear an obstruction from theassociated engine actuator. Additionally or alternatively, one or moreof the target values 266-270 may be controlled in a predetermined way todetermine a range of actuation of the associated engine actuator.Additionally or alternatively, one or more of the target values 266-270may be controlled in a predetermined way to determine whether a fault ispresent in an engine actuator.

The constraint setting module 352 may include a setpoint constraintmodule 504 and an actuator constraint module 508. The actuatorconstraint module 508 receives various requests 512 to set the targetvalues 266-270 in predetermined ways.

For example, a phaser diagnostic module 516 may generate a request forthe actuator constraint 364 (associated with the target intake camphaser angle 269) to be set to adjust the target intake cam phaser angle269 from a first predetermined boundary of an expected range ofoperation of the intake cam phaser 148 to a second predeterminedboundary of the expected range of operation of the intake cam phaser148. The phaser diagnostic module 516 may generate the request todiagnose whether a fault is present in the intake cam phaser 148 basedon a response of the intake cam phaser 148 to the request. For example,the phaser diagnostic module 516 may determine whether a fault ispresent in the intake cam phaser 148 based on whether the intake camphaser 148 is able to move from the first predetermined boundary to thesecond predetermined boundary.

The phaser diagnostic module 516 may generate this request, for example,when fuel is cutoff to the engine 102. If a fault is diagnosed in theintake cam phaser 148, the phaser diagnostic module 516 may notify theactuator constraint module 508 of the fault. When the fault is present,the actuator constraint module 508 may set the associated one of theactuator constraints 364 to limit the target intake cam phaser angle 269to a predetermined value or to within a predetermined range.

Additionally or alternatively, the phaser diagnostic module 516 maygenerate a request for the actuator constraint 364 (associated with thetarget exhaust cam phaser angle 270) to be set to adjust the targetexhaust cam phaser angle 270 from a third predetermined boundary of anexpected range of operation of the exhaust cam phaser 150 to a fourthpredetermined boundary of the expected range of operation of the exhaustcam phaser 150. The phaser diagnostic module 516 may generate therequest to diagnose whether a fault is present in the exhaust cam phaser150 based on a response of the exhaust cam phaser 150 to the request.For example, the phaser diagnostic module 516 may determine whether afault is present in the exhaust cam phaser 150 based on whether theexhaust cam phaser 150 is able to move from the third predeterminedboundary to the fourth predetermined boundary.

The phaser diagnostic module 516 may generate this request, for example,when fuel is cutoff to the engine 102. If a fault is diagnosed in theexhaust cam phaser 150, the phaser diagnostic module 516 may notify theactuator constraint module 508 of the fault. When the fault is present,the actuator constraint module 508 may set the associated one of theactuator constraints 364 to limit the target exhaust cam phaser value270 to a predetermined value or to within a predetermined range.

An EGR diagnostic module 520 may generate a request for the actuatorconstraint 364 (associated with the target EGR opening area 268) to beset to adjust the target EGR opening area 268 to open and close the EGRvalve 170. The EGR diagnostic module 520 may also generate the requestfor the actuator constraints 364 for the target throttle opening area267, the target intake and exhaust cam phaser angles 269 and 270, andthe target wastegate opening area 266 be maintained constant during theopening and closing of the EGR valve 170. Maintaining the targetthrottle opening area 267, the target intake and exhaust cam phaserangles 269 and 270, and the target wastegate opening area 266 while theEGR valve 170 is opened and closed may help to ensure that pressurechanges across the EGR valve 170 are attributable to opening and closingof the EGR valve 170.

The EGR diagnostic module 520 may generate the request to diagnosewhether a fault is present in the EGR valve 170. The EGR diagnosticmodule 520 may determine whether a fault is present in the EGR valve 170based on whether the pressure across the EGR valve 170 changes inresponse to opening and closing of the EGR valve 170.

The EGR diagnostic module 520 may generate this request, for example,when fuel is cutoff to the engine 102. If a fault is diagnosed in theEGR valve 170, the EGR diagnostic module 520 may notify the actuatorconstraint module 508 of the fault. When the fault is present, theactuator constraint module 508 may set the associated one of theactuator constraints 364 to limit the target EGR opening area 268 to apredetermined value or to within a predetermined range.

A wastegate range learning module 524 may generate a request for theactuator constraint 364 (associated with the target wastegate openingarea 266) to be set to adjust the target wastegate opening area 266 fromone boundary of an expected range of operation of the wastegate 162 tothe other boundary of the expected range of operation of the wastegate162. The wastegate range learning module 524 may learn a range ofoperation of the wastegate 162 based movement of the wastegate 162 inresponse to the request.

The wastegate range learning module 524 may notify the actuatorconstraint module 508 of the learned range of operation of the wastegate162. The actuator constraint module 508 may set the associated one ofthe actuator constraints 364 to limit the target wastegate opening area266 to within the learned range of operation of the wastegate 162 when afault is not present in the wastegate 162.

An EGR range learning module 528 may generate a request for the actuatorconstraint 364 (associated with the target EGR opening area 268) to beset to adjust the target EGR opening area 268 from one boundary of anexpected range of operation of the EGR valve 170 to the other boundaryof the expected range of operation of the EGR valve 170. The EGR rangelearning module 528 may learn a range of operation of the EGR valve 170based movement of the EGR valve 170 in response to the request.

The EGR range learning module 528 may notify the actuator constraintmodule 508 of the learned range of operation of the EGR valve 170. Theactuator constraint module 508 may set the associated one of theactuator constraints 364 to limit the target EGR opening area 268 towithin the learned range of operation of the EGR valve 170 when a faultis not present in the EGR valve 170.

A throttle range learning module 532 may generate a request for theactuator constraint 364 (associated with the target throttle openingarea 267) to be set to adjust the target throttle opening area 267 fromone boundary of an expected range of operation of the throttle valve 112to the other boundary of the expected range of operation of the throttlevalve 112. The throttle range learning module 532 may learn a range ofoperation of the throttle valve 112 based movement of the throttle valve112 in response to the request.

The throttle range learning module 532 may notify the actuatorconstraint module 508 of the learned range of operation of the throttlevalve 112. The actuator constraint module 508 may set the associated oneof the actuator constraints 364 to limit the target throttle openingarea 267 to within the learned range of operation of the throttle valve112 when a fault is not present in the throttle valve 112.

Range learning may also be requested and performed for the intake camphaser 148 and/or the exhaust cam phaser 150. The actuator constraintmodule 508 may limit the associated actuator constraints 364 to limitthe target intake and exhaust cam phaser angles 269 and 270 to withinthe learned ranges of operation of the intake and exhaust cam phasers148 and 150.

A phaser clearing module 536 may generate a request for the actuatorconstraint 364 (associated with the target intake cam phaser angle 269)to be set to adjust the target intake cam phaser angle 269 from a firstpredetermined angle to a second predetermined angle. The phaser clearingmodule 536 may generate the request, for example, when the phaserclearing module 536 determines that more force or power was required toadjust the intake cam phaser 148 to the target intake cam phaser angle269 than expected.

More force or power may be required, for example, when debris isimpeding motion of the intake cam phaser 148. Adjustment of the targetintake cam phaser angle 269 from the first predetermined angle to thesecond predetermined angle may be performed in an effort to clear thedebris and allow the intake cam phaser 148 to actuate freely. The firstand second predetermined angles may be set, for example, to the firstand second boundaries of the expected operating range of the intake camphaser 148 or to values that define a predetermined range around thetarget intake cam phaser angle 269 where the phaser clearing module 536determined that greater than expected force or power was required.

The phaser clearing module 536 may additionally or alternativelygenerate a request for the actuator constraint 364 (associated with thetarget exhaust cam phaser angle 270) to be set to adjust the targetexhaust cam phaser angle 270 from a third predetermined angle to afourth predetermined angle. The phaser clearing module 536 may generatethe request, for example, when the phaser clearing module 536 determinesthat more force or power was required to adjust the exhaust cam phaser150 to the target exhaust cam phaser angle 270 than expected.

More force or power may be required, for example, when debris isimpeding motion of the exhaust cam phaser 150. Adjustment of the targetexhaust cam phaser angle 270 from the third predetermined angle to thefourth predetermined angle may be performed in an effort to clear thedebris and allow the exhaust cam phaser 150 to actuate freely. The thirdand fourth predetermined angles may be set, for example, to the thirdand fourth boundaries of the expected operating range of the exhaust camphaser 150 or to values that define a predetermined range around thetarget exhaust cam phaser angle 270 where the phaser clearing module 536determined that greater than expected force or power was required.

An EGR clearing module 540 may generate a request for the actuatorconstraint 364 (associated with the target EGR opening area 268) to beset to adjust the target EGR opening area 268 from a first predeterminedopening to a second predetermined opening. The EGR clearing module 540may generate the request, for example, when the EGR clearing module 540determines that more force or power was required to adjust the EGR valve170 to the target EGR opening area 268 than expected.

More force or power may be required, for example, when debris isimpeding motion of the EGR valve 170. Adjustment of the target EGRopening area 268 from the first predetermined opening to the secondpredetermined opening may be performed in an effort to clear the debrisand allow the EGR valve 170 to actuate freely. The first and secondpredetermined openings may be set, for example, to predeterminedboundaries of an expected operating range of the EGR valve 170 or tovalues that define a predetermined range around the target EGR openingarea 268 where the EGR clearing module 540 determined that greater thanexpected force or power was required.

A throttle clearing module 544 may generate a request for the actuatorconstraint 364 (associated with the target throttle opening area 267) tobe set to adjust the target throttle opening area 267 from a thirdpredetermined opening to a fourth predetermined opening. The throttleclearing module 544 may generate the request, for example, when thethrottle clearing module 544 determines that more force or power wasrequired to adjust the throttle valve 112 to the target throttle openingarea 267 than expected.

More force or power may be required, for example, when debris (e.g.,ice) is impeding motion of the throttle valve 112. Adjustment of thetarget throttle opening area 267 from the third predetermined opening tothe fourth predetermined opening may be performed in an effort to clearthe debris and allow the throttle valve 112 to actuate freely. The thirdand fourth predetermined openings may be set, for example, topredetermined boundaries of an expected operating range of the throttlevalve 112 or to values that define a predetermined range around thetarget throttle opening area 267 where the throttle clearing module 544determined that greater than expected force or power was required.

While not shown, a wastegate clearing module may generate a request forthe actuator constraint 364 (associated with the target wastegateopening area 266) to be set to adjust the target wastegate opening area266 from a fifth predetermined opening to a sixth predetermined opening.The wastegate clearing module may generate the request, for example,when the wastegate clearing module determines that more force or powerwas required to adjust the wastegate 162 to the target wastegate openingarea 266 than expected.

More force or power may be required, for example, when debris isimpeding motion of the wastegate 162. Adjustment of the target wastegateopening area 266 from the fifth predetermined opening to the sixthpredetermined opening may be performed in an effort to clear the debrisand allow the wastegate 162 to actuate freely. The fifth and sixthpredetermined openings may be set, for example, to predeterminedboundaries of an expected operating range of the wastegate 162 or tovalues that define a predetermined range around the target wastegateopening area 266 where the wastegate clearing module determined thatgreater than expected force or power was required.

The actuator constraint module 508 arbitrates received requests forsetting one or more of the target values 266-270. For example, theactuator constraint module 508 may select one request as a winningrequest based on predetermined arbitration rules. The actuatorconstraint module 508 may set one or more of the actuator constraints364 based on the winning request. The actuator constraint module 508 mayset others of the actuator constraints 364 that are not affected by thewinning request to within their respective operating ranges.

Under some circumstances, the actuator constraint module 508 maydetermine that no received requests should be honored. In such a case,none of the actuator constraints 364 are set based on a receivedrequest.

The actuator constraint module 508 notifies requestors whose requestsare not honored, including requestors whose requests are not honoredpursuant to arbitration and requestors whose requests are not honoredfor one or more other reasons. The actuator constraint module 508 maynotify each requestor of whether or not its request was honored. Arequestor whose request is honored can perform the function for whichthe request was generated when the request is honored.

The setpoint constraint module 504 also receives the actuatorconstraints 364. The setpoint constraint module 504 generally sets thesetpoint constraints 348 to predetermined ranges for the setpointconstraints 348, respectively. The setpoint constraint module 504 mayselectively adjust one or more of the setpoint constraints 348 undersome circumstances.

For example, the setpoint constraint module 504 may adjust one or moreof the setpoint constraints 348 based on one or more of the actuatorconstraints 364. For example, when the target throttle opening area 267is limited based on its actuator constraint 364, the setpoint constraintmodule 504 may set the associated one of the setpoint constraints 348 tolimit the manifold pressure setpoint 318 based on the limitation of thetarget throttle opening area 267. For another example only, when thetarget intake cam phaser angle 269 is limited to a predetermined angle(e.g., parked) based on its actuator constraint 364 due to a fault theintake cam phaser 148, the setpoint constraint module 504 may set one ormore of the setpoints constraints 348 such that the MPC module 360 willset the target intake cam phaser angle 269 to the predetermined angle.The setpoint constraint module 504 adjusting one or more of the setpointconstraints 348 based on one or more of the actuator constraints 364 maycause the setpoint module 312 to set the setpoints 318-332 to valuesthat are achievable by the MPC module 360.

Referring now to FIG. 6, a flowchart depicting an example method ofsetting one of the actuator constraints 364 and controlling theassociated engine actuator based on that actuator constraint 364 ispresented. At 604, the actuator constraint module 508 receives a requestto set one of the target values 266-270 in a predetermined way. Whilethe following will be discussed in terms of a request to set one of thetarget values 266-270, the request may also specify how to set one ormore of the other target values 266-270. One or more other requests mayalso be received at 604.

At 608, the actuator constraint module 508 performs arbitration on thereceived request to determine whether to honor the received request. At612, the actuator constraint module 508 notifies requestors whoserequests were not honored. The actuator constraint module 508 may alsonotify the requestor whose request was honored so the function for whichthe request was generated can be performed.

At 616, the actuator constraint module 508 sets the associated one ofthe actuator constraints 364 based on the received request. For example,the actuator constraint module 508 may set the predetermined range ofthe associated one of the actuator constraints 364 to one value at 616such that the associated one of the target values 266-270 will be set tothat one value. The actuator constraint module 508 may selectivelyadjust the predetermined range over time to control the one of theactuator constraints 364 in the predetermined way. While FIG. 6 isdescribed in terms of the request received in 604 winning thearbitration and being honored, no requests may be honored under somecircumstances.

The MPC module 360 limits the one of the target values 266-270 that isassociated with the one of the actuator constraints 364 based on the oneof the actuator constraints 364 at 620. For example, the MPC module 360may set the one of the target values 266-270 to the one of the actuatorconstraints 364. The target values 266-270 may be converted, forexample, into target duty cycles to be applied to the correspondingengine actuators. At 624, the associated actuator module controls theassociated engine actuator based on the one of the target values266-270. In this manner, the associated engine actuator is controlled asrequested, for example, to determine whether a fault is present in theengine actuator, to learn a range of operation of the engine actuator,or to clear debris from the engine actuator.

At 628, the setpoint constraint module 504 may determine whether one ormore of the setpoint constraints 348 can be adjusted based on theactuator constraint 364. If 628 is true, the setpoint constraint module504 may selectively adjust one or more of the setpoint constraints 348based on the actuator constraint 364 at 632, and control may end. If 628is false, the setpoint constraint module 504 may refrain from adjustingthe setpoint constraints 348 and control may end. While FIG. 6 is shownand discussed as ending, FIG. 6 may be illustrative of one control loop,and control loops may be executed at a predetermined rate.

Referring now to FIG. 7, a functional block diagram of an example fuelsystem is presented. A fuel system supplies liquid fuel and fuel vaporto the engine 102. The fuel system includes a fuel tank 704 thatcontains liquid fuel. Liquid fuel is drawn from the fuel tank 704 andsupplied to the fuel injectors by one or more fuel pumps (not shown).

Some conditions, such as heat, vibration, and/or radiation, may causeliquid fuel within the fuel tank 704 to vaporize. A vapor canister 708traps and stores vaporized fuel (fuel vapor). The vapor canister 708 mayinclude one or more substances that trap and store fuel vapor, such asone or more types of charcoal.

Operation of the engine 102 may create a vacuum within the intakemanifold 110. A purge valve 712 may be selectively opened to draw fuelvapor from the vapor canister 708 to the intake manifold 110. A purgecontrol module 716 may control the purge valve 712 to control the flowof fuel vapor to the engine 102. The purge control module 716 alsocontrols a switching (vent) valve 720.

When the switching valve 720 is in a vent (open) position, the purgecontrol module 716 may selectively open the purge valve 712 to purgefuel vapor from the vapor canister 708 to the intake manifold 110. Theintake manifold 110 draws fuel vapor from the vapor canister 708 throughthe purge valve 712 to the intake manifold 110. Ambient air is drawninto the vapor canister 708 through the switching valve 720 as fuelvapor is drawn from the vapor canister 708. In various implementations,the purge control module 716 may be implemented within the ECM 114.

Referring now to FIG. 8, a functional block diagram of an example vacuumand setpoint control system is presented. As discussed above, thesetpoint module 312 generate the setpoints 318-332 based on the base airtorque request 308, the engine speed 316, the desired combustion phasing336, and the cylinder mode 340, subject to the setpoint constraints 348.

The setpoint module 312 may selectively adjust one or more of thesetpoints 318-332 under one or more circumstances, such as to createvacuum (relative to ambient air pressure) within the intake manifold110. The setpoint module 312 may selectively adjust one or more of thesetpoints to create vacuum within the intake manifold 110, for example,to increase vacuum within a brake booster (not shown), to purge fuelvapor from the vapor canister 708, and/or to diagnose a leak in the fuelsystem (FIG. 7), such as in the purge valve 712 and/or the switchingvalve 720.

A vacuum requesting module 804 selectively generates a vacuum request808 to create vacuum within the intake manifold 110. The vacuum request808 may include an amount of vacuum relative to ambient air pressure.The vacuum requesting module 804 may generate the vacuum request 808 andset the amount of vacuum based on a requestor of the intake manifoldvacuum and one or more other parameters.

A driver actuates a brake pedal to apply brakes of the vehicle to slowthe vehicle. A brake booster helps the driver apply the brakes of thevehicle using vacuum drawn from the intake manifold. The brake boosterdraws vacuum from the intake manifold when vacuum within the intakemanifold is greater than vacuum within the brake booster.

Vacuum may be created within the intake manifold 110, for example, byclosing the throttle valve 112. However, some engines are controlled tominimize throttling, for example, to minimize pumping losses andincrease fuel efficiency. Accordingly, the vacuum within the intakemanifold 110 may be low, zero, or even negative (i.e., intake manifoldpressure greater than ambient pressure) under some circumstances.

A brake booster requesting module 812 selectively requests creation ofvacuum within the intake manifold 110 in response to driver actuation ofa brake pedal. Driver actuation of the brake pedal causes vacuum withinthe brake booster to decrease. The brake booster requesting module 812may generate the request, for example, when vacuum within the brakebooster is less than a predetermined vacuum. The vacuum within the brakebooster may be measured, for example, using a sensor or determined forexample, based on driver actuation of the brake pedal. When the brakebooster requesting module 812 requests creation of vacuum within theintake manifold 110 to increase the vacuum within the brake booster, thevacuum requesting module 804 may set the vacuum request 808 to a firstpredetermined vacuum.

A purge requesting module 816 selectively requests creation of vacuumwithin the intake manifold 110 when an amount of fuel vapor within thevapor canister 708 is greater than a predetermined amount. As discussedabove, vacuum draws fuel vapor from the vapor canister 708 to the intakemanifold 110. The vacuum requesting module 804 may set the vacuumrequest 808 to a second predetermined vacuum when the purge requestingmodule 816 requests creation of vacuum within the intake manifold 110 topurge fuel vapor from the vapor canister 708.

A leak diagnostic requesting module 820 selectively requests creation ofvacuum within the intake manifold 110 for performance of one or morefault diagnostics. More specifically, the leak diagnostic requestingmodule 820 determines whether one or more leaks are present in the fuelsystem (FIG. 7) based on vacuum within the intake manifold 110. Thevacuum requesting module 804 may set the vacuum request 808 to a thirdpredetermined vacuum when the leak diagnostic requesting module 820requests creation of vacuum within the intake manifold 110 for the faultdiagnostic(s).

The vacuum requesting module 804 notifies requestors of intake manifoldvacuum when the vacuum requesting module 804 is generating the vacuumrequest 808 honoring a request for intake manifold vacuum. The requestorcan then perform the function associated with the request, if any.

The setpoint module 312 selectively adjusts one or more of the setpoints318-332 based on the vacuum request 808 to create vacuum within theintake manifold 110. For example, the setpoint module 312 may decreasethe external dilution setpoint 324, decrease the residual dilutionsetpoint 328, and/or increase the effective compression ratio setpoint332 based on the vacuum request 808.

While FIG. 8 is discussed in terms of the setpoints 318-332, FIG. 8 isalso applicable to the setpoints 380-392 (FIG. 3B). For example, basedon the vacuum request 808, the setpoint module 312 may decrease the EGRsetpoint 384 and/or adjust the intake and/or exhaust cam phasingsetpoints 388 and 392 to maximize volumetric efficiency, reduce internaldilution, and/or increase effective compression ratio.

The vacuum requesting module 804 may also generate a priority signal 824that indicates a priority of the vacuum request 808. The setpoint module312 may adjust one or more of the setpoints or determine when to adjustone or more of the setpoints based on the priority signal 824. Forexample, when the priority signal 824 is set to a first state,indicating a high priority, the setpoint module 312 may adjust one ormore of the setpoints more quickly and/or sooner at the cost ofdecreased fuel efficiency. The setpoint module 312 may adjust one ormore of the setpoints more slowly and/or later when the priority signal824 is set to other states to indicate a lower priority.

The vacuum requesting module 804 may set the priority signal 824 basedon the requestor of intake manifold vacuum and/or one or more otherparameters. For example, the vacuum requesting module 804 may set thepriority signal 824 to the high priority when the brake boosterrequesting module 812 is requesting intake manifold vacuum for the brakebooster. The vacuum requesting module 804 may also set the prioritysignal 824 to the high priority when an amount of fuel vapor within thevapor canister 708 is greater than a first predetermined amount. Thefirst predetermined amount may be, for example, approximately 80 percentof a maximum amount that the vapor canister 708 can store or anothersuitable amount.

The vacuum requesting module 804 may set the priority signal 824 to asecond state, indicating a lower priority, when the amount of fuel vaporwithin the vapor canister 708 is less than a second predeterminedamount. The second predetermined amount is less than the firstpredetermined amount and may be, for example, approximately 60 percentof the maximum amount or another suitable amount. The vacuum requestingmodule 804 may set the priority signal 824 to a lower priority when theleak diagnostic requesting module 820 is requesting intake manifoldvacuum.

When the priority signal 824 is set to the first state (indicating highpriority), the setpoint module 312 may determine whether the vacuumrequest 808 can be satisfied under the current cylinderactivation/deactivation and gear conditions. If not, the setpoint module312 may request that one or more changes be made so the vacuum request808 can be satisfied.

For example, the setpoint module 312 may determine whether an amount oftorque necessary to create the amount of vacuum requested is greaterthan a maximum amount of torque that the engine 102 can produce with thepresent number of cylinders activated. If the amount of torque necessaryto create the requested amount of intake manifold vacuum is greater thanthe maximum amount of torque that the engine 102 can produce with thepresent number of cylinders activated, the setpoint module 312 maygenerate a request 826 that one or more deactivated cylinders beactivated so the vacuum request 808 can be achieved. For example, thesetpoint module 312 may request the cylinder control module 236 todecrease the target number of deactivated cylinders and increase thetarget number of activated cylinders. One or more deactivated cylindersmay be activated based on the request 826.

The setpoint module 312 may additionally or alternatively determinewhether an amount of torque necessary to create a requested amount ofintake manifold vacuum could be created if the transmission was shiftedto a lower gear than a present gear (to increase the engine torquenecessary to achieve a current axle torque request). If so, the setpointmodule 312 may generate a request 828 to shift the transmission to thelower gear. The transmission control module 194 may selectively performa gear shift to the lower gear so the vacuum request 808 can besatisfied.

Referring now to FIG. 9, a flowchart depicting an example method ofselectively adjusting one or more of the setpoints input to the MPCmodule 360 is presented. At 904, the vacuum requesting module 804receives a request to create vacuum within the intake manifold 110. Forexample, the brake booster requesting module 812 may generate therequest for increasing vacuum within the brake booster, the purgerequesting module 816 may generate the request to purge fuel vapor fromthe vapor canister 708, or the leak diagnostic requesting module 820 maygenerate the request for performing the fault diagnostic(s). The vacuumrequesting module 804 may generate the vacuum request 808 at 904 andnotify the requestor accordingly.

At 908, the setpoint module 312 may determine whether the vacuum request808 can be satisfied with the current number of activated cylinders. If908 is true, control may transfer to 920, which is discussed furtherbelow. If 908 is false, control may continue with 912.

The setpoint module 312 may determine whether one or more cylinders aredeactivated at 912. If 912 is false, control may end. If 912 is true,the setpoint module 312 may determine whether the vacuum request 808 canbe satisfied with a greater number of cylinders activated at 914. If 914is true, the setpoint module 312 may request that one or more cylindersbe activated to so the vacuum request 808 can be satisfied at 916, andcontrol may continue with 920. If 914 is false, control may end.

At 920, the setpoint module 312 may selectively adjust one or more ofthe setpoints 318-332 or the setpoint 380-392 based on the vacuumrequest 808. For example, the setpoint module 312 may decrease theexternal dilution setpoint 324, decrease the residual dilution setpoint328, and/or increase the effective compression ratio setpoint 332 basedon the vacuum request 808. Using the setpoints 380-392, the setpointmodule 312 may decrease the EGR setpoint 384 and/or adjust the intakeand/or exhaust cam phasing setpoints 388 and 392 to maximize volumetricefficiency, reduce internal dilution, and/or increase effectivecompression ratio.

At 924, the MPC module 360 generates the target values 266-270 based onthe setpoints, subject to the actuator constraints 364, using MPC. Morespecifically, as described above, the MPC module 360 identifies possiblesequences of the target values 266-270 and generates predicted responsesusing the model 376. The MPC module 360 also determines costs for thepossible sequences based on the predicted responses, selects one of thepossible sequences based on the costs, and sets the target values266-270 based on the first ones of the target values in the selectedpossible sequence, respectively.

At 928, the first conversion module 272 converts the target wastegateopening area 266 into the target duty cycle 274 to be applied to thewastegate 162, the second conversion module 276 converts the targetthrottle opening area 267 into the target duty cycle 278 to be appliedto the throttle valve 112. The third conversion module 280 also convertsthe target EGR opening area 268 into the target duty cycle 282 to beapplied to the EGR valve 170 at 420. The fourth conversion module mayalso convert the target intake and exhaust cam phaser angles 269 and 270into the target intake and exhaust duty cycles to be applied to theintake and exhaust cam phasers 148 and 150, respectively.

At 932, the throttle actuator module 116 controls the throttle valve 112to achieve the target throttle opening area 267, and the phaser actuatormodule 158 controls the intake and exhaust cam phasers 148 and 150 toachieve the target intake and exhaust cam phaser angles 269 and 270,respectively. For example, the throttle actuator module 116 may apply asignal to the throttle valve 112 at the target duty cycle 278 to achievethe target throttle opening area 267. Also at 424, the EGR actuatormodule 172 controls the EGR valve 170 to achieve the target EGR openingarea 268, and the boost actuator module 164 controls the wastegate 162to achieve the target wastegate opening area 266. For example, the EGRactuator module 172 may apply a signal to the EGR valve 170 at thetarget duty cycle 282 to achieve the target EGR opening area 268, andthe boost actuator module 164 may apply a signal to the wastegate 162 atthe target duty cycle 274 to achieve the target wastegate opening area266. While FIG. 9 is shown and described as ending, FIG. 9 may beillustrative of one control loop, and control loops may be executed at apredetermined rate.

Referring now to FIG. 10, a flowchart depicting another example methodof selectively adjusting one or more of the setpoints input to the MPCmodule 360 is presented. At 1004, the vacuum requesting module 804receives a request to create vacuum within the intake manifold 110. Forexample, the brake booster requesting module 812 may generate therequest for increasing vacuum within the brake booster, the purgerequesting module 816 may generate the request to purge fuel vapor fromthe vapor canister 708, or the leak diagnostic requesting module 820 maygenerate the request for performing the fault diagnostic(s). The vacuumrequesting module 804 may generate the vacuum request 808 at 1004 andnotify the requestor accordingly.

At 1008, the setpoint module 312 may determine whether the vacuumrequest 808 can be satisfied with the transmission in the current gear.If 1008 is true, control may transfer to 1020, which is discussedfurther below. If 1008 is false, control may continue with 1012.

The setpoint module 312 may determine whether the vacuum request 808 canbe satisfied if the transmission is shifted to a lower gear at 1012. If1012 is false, control may end. If 1012 is true, control may continuewith 1016. At 1016, the setpoint module 312 may request that thetransmission control module shift the transmission to the lower gear at1016.

At 1020, the setpoint module 312 may selectively adjust one or more ofthe setpoints 318-332 or the setpoint 380-392 based on the vacuumrequest 808. For example, the setpoint module 312 may decrease theexternal dilution setpoint 324, decrease the residual dilution setpoint328, and/or increase the effective compression ratio setpoint 332 basedon the vacuum request 808. Using the setpoints 380-392, the setpointmodule 312 may decrease the EGR setpoint 384 and/or adjust the intakeand/or exhaust cam phasing setpoints 388 and 392 to maximize volumetricefficiency, reduce internal dilution, and/or increase effectivecompression ratio. Control may then continue with 924-932, as discussedabove. While FIG. 10 is shown and described as ending, FIG. 10 may beillustrative of one control loop, and control loops may be executed at apredetermined rate.

The foregoing description is merely illustrative in nature and is in noway intended to limit the disclosure, its application, or uses. Thebroad teachings of the disclosure can be implemented in a variety offorms. Therefore, while this disclosure includes particular examples,the true scope of the disclosure should not be so limited since othermodifications will become apparent upon a study of the drawings, thespecification, and the following claims. As used herein, the phrase atleast one of A, B, and C should be construed to mean a logical (A or Bor C), using a non-exclusive logical OR. It should be understood thatone or more steps within a method may be executed in different order (orconcurrently) without altering the principles of the present disclosure.

In this application, including the definitions below, the term modulemay be replaced with the term circuit. The term module may refer to, bepart of, or include an Application Specific Integrated Circuit (ASIC); adigital, analog, or mixed analog/digital discrete circuit; a digital,analog, or mixed analog/digital integrated circuit; a combinationallogic circuit; a field programmable gate array (FPGA); a processor(shared, dedicated, or group) that executes code; memory (shared,dedicated, or group) that stores code executed by a processor; othersuitable hardware components that provide the described functionality;or a combination of some or all of the above, such as in asystem-on-chip.

The term code, as used above, may include software, firmware, and/ormicrocode, and may refer to programs, routines, functions, classes,and/or objects. The term shared processor encompasses a single processorthat executes some or all code from multiple modules. The term groupprocessor encompasses a processor that, in combination with additionalprocessors, executes some or all code from one or more modules. The termshared memory encompasses a single memory that stores some or all codefrom multiple modules. The term group memory encompasses a memory that,in combination with additional memories, stores some or all code fromone or more modules. The term memory may be a subset of the termcomputer-readable medium. The term computer-readable medium does notencompass transitory electrical and electromagnetic signals propagatingthrough a medium, and may therefore be considered tangible andnon-transitory. Non-limiting examples of a non-transitory tangiblecomputer readable medium include nonvolatile memory, volatile memory,magnetic storage, and optical storage.

The apparatuses and methods described in this application may bepartially or fully implemented by one or more computer programs executedby one or more processors. The computer programs includeprocessor-executable instructions that are stored on at least onenon-transitory tangible computer readable medium. The computer programsmay also include and/or rely on stored data.

What is claimed is:
 1. An engine control system for a vehicle,comprising: a torque requesting module that generates a first torquerequest for a spark ignition engine based on driver input; a torqueconversion module that converts the first torque request into a secondtorque request; a setpoint control module that, based on the secondtorque request, generates a mass of air per cylinder (APC) setpoint, anexhaust gas recirculation (EGR) setpoint, an intake valve phasingsetpoint, and an exhaust valve phasing setpoint; a model predictivecontrol (MPC) module that identifies sets of possible target valuesbased on the APC, EGR, intake valve phasing, and exhaust valve phasingsetpoints, that generates predicted parameters based on a model of thespark ignition engine and the sets of possible target values,respectively, that selects one of the sets of possible target valuesbased on the predicted parameters, and that sets target values based onthe possible target values of the selected one of the sets; and athrottle actuator module that controls opening of a throttle valve basedon a first one of the target values.
 2. The engine control system ofclaim 1 further comprising: a boost actuator module that controlsopening of a wastegate based on a second one of the target values; anexhaust gas recirculation (EGR) actuator module that controls opening ofan EGR valve based on a third one of the target values; and a phaseractuator module that controls intake and exhaust valve phasing based onfourth and fifth ones of the target values.
 3. The engine control systemof claim 1 wherein the MPC module selects the one of the sets ofpossible target values further based on the APC, EGR, intake valvephasing, and exhaust valve phasing setpoints.
 4. The engine controlsystem of claim 3 wherein the MPC module selects the one of the sets ofpossible target values based on comparisons of the APC, EGR, intakevalve phasing, and exhaust valve phasing setpoints with the predictedparameters, respectively.
 5. The engine control system of claim 1wherein the MPC module: determines costs for the sets based on: firstcomparisons of the APC setpoint with predicted APCs determined for thesets, respectively; second comparisons of the EGR setpoint withpredicted EGRs determined for the sets, respectively; third comparisonsof the intake valve phasing setpoint with predicted intake valve phasingvalues determined for the sets, respectively; and fourth comparisons ofthe exhaust valve phasing setpoint with predicted exhaust phasing valuesdetermined for the sets, respectively; and selects the one of the setsof possible target values based on the costs.
 6. The engine controlsystem of claim 5 wherein the MPC module applies first, second, third,and fourth weighting values to the first, second, third, and fourthcomparisons, respectively, to determine the costs, and wherein the firstweighting value is one of greater than and less than all of the second,third, and fourth weighting values.
 7. The engine control system ofclaim 1 wherein the MPC module sets the target values to withinpredetermined ranges for the target values, respectively.
 8. The enginecontrol system of claim 1 wherein the setpoint module generates the APC,EGR, intake valve phasing, and exhaust valve phasing setpoints furtherbased on desired combustion phasing.
 9. The engine control system ofclaim 1 wherein the setpoint module generates the APC, EGR, intake valvephasing, and exhaust valve phasing setpoints further based onpredetermined ranges for the APC, EGR, intake valve phasing, and exhaustvalve phasing setpoints, respectively.
 10. The engine control system ofclaim 1 wherein the setpoint module generates the APC, EGR, intake valvephasing, and exhaust valve phasing setpoints further based on a numberof deactivated cylinders.
 11. An engine control method for a vehicle,comprising: generating a first torque request for a spark ignitionengine based on driver input; converting the first torque request into asecond torque request; generating, based on the second torque request, amass of air per cylinder (APC) setpoint, an exhaust gas recirculation(EGR) setpoint, an intake valve phasing setpoint, and an exhaust valvephasing setpoint; using a model predictive control (MPC) module:identifying sets of possible target values based on the APC, EGR, intakevalve phasing, and exhaust valve phasing setpoints; generating predictedparameters based on a model of the spark ignition engine and the sets ofpossible target values, respectively; selecting one of the sets ofpossible target values based on the predicted parameters; and setstarget values based on the possible target values of the selected one ofthe sets; and controlling opening of a throttle valve based on a firstone of the target values.
 12. The engine control method of claim 11further comprising: controlling opening of a wastegate based on a secondone of the target values; controlling opening of an exhaust gasrecirculation (EGR) valve based on a third one of the target values; andcontrolling intake and exhaust valve phasing based on fourth and fifthones of the target values.
 13. The engine control method of claim 11further comprising selecting the one of the sets of possible targetvalues further based on the APC, EGR, intake valve phasing, and exhaustvalve phasing setpoints.
 14. The engine control method of claim 13further comprising selecting the one of the sets of possible targetvalues based on comparisons of the APC, EGR, intake valve phasing, andexhaust valve phasing setpoints with the predicted parameters,respectively.
 15. The engine control method of claim 11 furthercomprising: determining costs for the sets based on: first comparisonsof the APC setpoint with predicted APCs determined for the sets,respectively; second comparisons of the EGR setpoint with predicted EGRsdetermined for the sets, respectively; third comparisons of the intakevalve phasing setpoint with predicted intake valve phasing valuesdetermined for the sets, respectively; and fourth comparisons of theexhaust valve phasing setpoint with predicted exhaust phasing valuesdetermined for the sets, respectively; and selecting the one of the setsof possible target values based on the costs.
 16. The engine controlmethod of claim 15 further comprising applying first, second, third, andfourth weighting values to the first, second, third, and fourthcomparisons, respectively, to determine the costs, and wherein the firstweighting value is one of greater than and less than all of the second,third, and fourth weighting values.
 17. The engine control method ofclaim 11 further comprising setting the target values to withinpredetermined ranges for the target values, respectively.
 18. The enginecontrol method of claim 11 further comprising generating the APC, EGR,intake valve phasing, and exhaust valve phasing setpoints further basedon desired combustion phasing.
 19. The engine control method of claim 11further comprising generating the APC, EGR, intake valve phasing, andexhaust valve phasing setpoints further based on predetermined rangesfor the APC, EGR, intake valve phasing, and exhaust valve phasingsetpoints, respectively.
 20. The engine control method of claim 11further comprising generating the APC, EGR, intake valve phasing, andexhaust valve phasing setpoints further based on a number of deactivatedcylinders.